/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Floors;

import Actors.Actor;
import ElementsProperties.ActorEntranceSensible;

/**
 *
 * @author Snowangelic
 */
public class UnstableBridge extends Floor implements ActorEntranceSensible{

    int survivalTime;
    boolean isDestroying;
    
    public UnstableBridge(){
        isDestroying=false;
        survivalTime=150;
        floorImage=EnigmaUtils.ImageLoader.loadImage("./images/unstableBridge.png");
    }
    @Override
    public void update(long dtime) {
        if(isDestroying==true){
            survivalTime-=dtime;
        }
        if(survivalTime<=0){
            myCase.setFloor(new WaterFloor());
        }
    }

    @Override
    public void actorEnters(Actor actor) {
        isDestroying=true;
    }

    @Override
    public void actorLeaves(Actor actor) {
    }

}
